package cnpm02.j2ee.group3.model;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.hibernate.validator.NotNull;

@Entity
@Table(name = "PLANE", uniqueConstraints = @UniqueConstraint(columnNames = {
                "PlaneCode"}))
@AttributeOverride(name = "id", column = @Column(name = "PlaneId"))
public class Plane extends AbstractEntity {
	private static final long serialVersionUID = 1L;

	@NotNull
	@Column(name = "PlaneCode", length = 10, nullable = false)
	private String planeCode;
	
	@NotNull
	@Column(name = "PlaneName", nullable = false)
	private String planeName;
	
	@NotNull
	@Column(name = "PlaneCount", nullable = false)
	private int planeCount;
	
	@NotNull
	@Column(name="SeatCount", nullable = false)
	private int planeSeatCount;
	
	public Plane(){
		super();
	}
	
	public Plane(String _planeCode, String _planeName, int _planeCount){
		super();
		planeCode = _planeCode;
		planeName = _planeName;
		planeCount = _planeCount;
	}
	
	public void setPlaneCode(String planeCode) {
		this.planeCode = planeCode;
	}
	
	public String getPlaneCode() {
		return planeCode;
	}

	public void setPlaneName(String planeName) {
		this.planeName = planeName;
	}

	public String getPlaneName() {
		return planeName;
	}

	public void setPlaneCount(int planeCount) {
		this.planeCount = planeCount;
	}

	public int getPlaneCount() {
		return planeCount;
	}

	public void setPlaneSeatCount(int planeSeatCount) {
		this.planeSeatCount = planeSeatCount;
	}

	public int getPlaneSeatCount() {
		return planeSeatCount;
	}

}
